package com.imooc.demo.service.impl;

import com.imooc.demo.dao.BoardDao;
import com.imooc.demo.entity.Board;
import com.imooc.demo.entity.UserInfo;
import com.imooc.demo.service.BoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

@Service
public class BoardServiceImpl implements BoardService {
    @Autowired
    BoardDao boardDao;
    @Override
    public boolean messagesInsert(Board board) {
        return boardDao.messagesInsert(board);
    }

    @Override
    public List<Board> findMessagesByOpenid(String buyerOpenid) {
        return boardDao.findMessagesByOpenid(buyerOpenid);
    }

    @Override
    public Board findMessagesById(Integer boardId) {
        return boardDao.findMessagesById(boardId);
    }

    @Override
    public boolean messagesDelete(Board board) {
        return boardDao.messagesDelete(  board);
    }

    @Override
    public boolean replyInsert(Board board) {
        return boardDao.replyInsert(board);
    }

    @Override
    public List<UserInfo> getReply(String buyerOpenid) {
        return boardDao.getReply(buyerOpenid);
    }

    @Override
    public List<Board> getUnRead(String buyerOpenid) {

        return boardDao.getUnRead(buyerOpenid);

    }

    @Override
    public boolean setReadStatus(Board board) {
        return boardDao.setReadStatus(board);
    }

    @Override
    public List<Board> getBoardByBoardId(Integer boardId) {
        return boardDao.getBoardByBoardId(boardId);
    }
}
